﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//using System.Windows.Media.Imaging;
//using System.Windows.Media.Imaging.BitmapImage;
//using System.Windows.Media;
//using System.Windows.Controls;

using System.Collections.ObjectModel;
using System.Drawing;
using System.Windows.Media.Imaging;


namespace intern_project1.ViewModel
{
    public class MainDiagnosisImageViewModel
    {
        //string imgP = "C:/Users/user/Desktop/14.09.22_intern_project1/intern_project1/Resources/health.jpg";
        //string imageP = "../Resources/health.jpg";
        //string imageP = "pack://siteoforigin:,,,/Resources/health.jpg";

        
        //string i = (string)intern_project1.Properties.Resources.health;
        //string i = intern_project1.Properties.Resources.health as string;

        ObservableCollection<Diaglmg> diagImgs = new ObservableCollection<Diaglmg>();

/* 진단 이미지 데이터 입력 */
        public MainDiagnosisImageViewModel()
        {
            //Image image = Image.FromFile("../../heath");
            //using(Image image = Image.FromFile(this.imagePath))
            
            //Bitmap pImg = intern_project1.Properties.Resources.health;
            //Bitmap jellyfish = intern_project1.Properties.Resources.Jellyfish;
            //BitmapImage jellyfish = intern_project1.Properties.Resources.Jellyfish;

            //Image image = Bitmap.FromFile("image/j.jpg");
            //Uri uri = new Uri(new StringBuilder("pack://application:,,/").Append(imageP).ToString());
            //BitmapImage bitmap = new BitmapImage(uri);
            
            //Image asdf = Bitmap.FromResource(intern_project1.Properties.Resources.Jellyfish);

            //Image et = new Bitmap("image/j.jpg");   //??? 될까?

            //diagImgs.Add(new Diaglmg(pImg));
            //diagImgs.Add(new Diaglmg(image));
            //diagImgs.Add(new Diaglmg(bit2img));

            DiagImgs.Add(new Diaglmg("C:/Users/user/Desktop/14.09.22_intern_project1/intern_project1/Resources/health.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Chrysanthemum.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Hydrangeas.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Jellyfish.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Koala.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Lighthouse.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Penguins.jpg",
                        "C:\\Users\\Public\\Pictures\\Sample Pictures\\Tulips.jpg"));
        }

        //private Image ResourceToImage(string source)
        //{
        //    //Uri uri = new Uri(new StringBuilder("pack://application:,,/").Append(source).ToString());
        //    Uri uri = new Uri(new StringBuilder("pack://siteoforigin:,,,/Jellyfish.jpg").Append(source).ToString());
        //    BitmapImage bitmap = new BitmapImage(uri);

        //    //Image img = new Image();
        //    //img.Source = bitmap;

        //    //return img;
        //}

/* 객체데이터 인캡슐화 */
        
        public ObservableCollection<Diaglmg> DiagImgs
        {
            get { return diagImgs; }
            set { diagImgs = value; }
        }
    }

/* DiagImg 클래스 */
    public class Diaglmg        // Diagnosis Image
    {
        Bitmap pImg;
        Image image;

        /*string imagePath = "C:/Users/user/Desktop/14.09.22_intern_project1/intern_project1/Resources/health.jpg";        //이 방법으로 일단은 띄울수는 있는 것같음. 그러나 이미지 자체를 넘기는데는 무리가 있어보임
        string bottomImagePath1 = "C:\\Users\\Public\\Pictures\\Sample Pictures\\국화.jpg";
        string bottomImagePath2 = "C:\\Users\\Public\\Pictures\\Sample Pictures\\사막.jpg";
        string bottomImagePath3 = "C:\\Users\\Public\\Pictures\\Sample Pictures\\수국.jpg";
        string bottomImagePath4 = "C:\\Users\\Public\\Pictures\\Sample Pictures\\해파리.jpg";
        string bottomImagePath5 = "C:\\Users\\Public\\Pictures\\Sample Pictures\\코알라.jpg";
        string bottomImagePath6 = "C:\\Users\\Public\\Pictures\\Sample Pictures\\등대.jpg";
        string bottomImagePath7 = "C:\\Users\\Public\\Pictures\\Sample Pictures\\펭귄.jpg";
         * */
        string imagePath;
        string bottomImagePath1;
        string bottomImagePath2;
        string bottomImagePath3;
        string bottomImagePath4;
        string bottomImagePath5;
        string bottomImagePath6;
        string bottomImagePath7;
        string bottomImagePath8;

        /* DiagImg 생성자 */
        
        public Diaglmg(Bitmap img)
        {
            pImg = img;
        }
        public Diaglmg(Image img)
        {
            image = img;
        }
        public Diaglmg(string imageP, string bimageP1, string bimageP2, string bimageP3, string bimageP4, string bimageP5, string bimageP6, string bimageP7, string bimageP8)
        {
            imagePath = imageP;
            bottomImagePath1 = bimageP1;
            bottomImagePath2 = bimageP2;
            bottomImagePath3 = bimageP3;
            bottomImagePath4 = bimageP4;
            bottomImagePath5 = bimageP5;
            bottomImagePath6 = bimageP6;
            bottomImagePath7 = bimageP7;
            bottomImagePath8 = bimageP8;
        }
        
   
        public Bitmap PImg
        {
            get { return pImg; }
            set { pImg = value; }
        }
        public Image Image
        {
            get { return image; }
            set { image = value; }
        }

        public string ImagePath
        {
            get { return imagePath; }
            set { imagePath = value; }
        }
        public string BottomImagePath1
        {
            get { return bottomImagePath1; }
            set { bottomImagePath1 = value; }
        }
        public string BottomImagePath2
        {
            get { return bottomImagePath2; }
            set { bottomImagePath2 = value; }
        }
        public string BottomImagePath3
        {
            get { return bottomImagePath3; }
            set { bottomImagePath3 = value; }
        }
        public string BottomImagePath4
        {
            get { return bottomImagePath4; }
            set { bottomImagePath4 = value; }
        }
        public string BottomImagePath5
        {
            get { return bottomImagePath5; }
            set { bottomImagePath5 = value; }
        }
        public string BottomImagePath6
        {
            get { return bottomImagePath6; }
            set { bottomImagePath6 = value; }
        }
        public string BottomImagePath7
        {
            get { return bottomImagePath7; }
            set { bottomImagePath7 = value; }
        }
        public string BottomImagePath8
        {
            get { return bottomImagePath8; }
            set { bottomImagePath8 = value; }
        }

    }

    
}